package metalink.admin;
import com.opensymphony.xwork2.ActionSupport;
import java.util.*;
import java.sql.*;
import vo.*;
import vo.mixed.*;
import model.admin.*;
import myutil.*;
public class Message_Specialization extends ActionSupport{
	ArrayList<DepartmentDetailsVo> departments_list=new ArrayList<DepartmentDetailsVo>();
	ArrayList<StudentDetailsVo> student_list=new ArrayList<StudentDetailsVo>();
	
	public ArrayList<DepartmentDetailsVo> getDepartments_list() {
		return departments_list;
	}

	public void setDepartments_list(ArrayList<DepartmentDetailsVo> departments_list) {
		this.departments_list = departments_list;
	}

	public ArrayList<StudentDetailsVo> getStudent_list() {
		return student_list;
	}

	public void setStudent_list(ArrayList<StudentDetailsVo> student_list) {
		this.student_list = student_list;
	}

	public String execute(){
		try {
			
			Connect c=new Connect();
			ResultSet rs=c.getResult("select * from department_details");
		
			while(rs.next())
			{
			DepartmentDetailsVo single_object=new DepartmentDetailsVo();
			single_object.setDepartment_id(rs.getInt("department_id"));
			single_object.setDepartment_name(rs.getString("department_name"));
			
			departments_list.add(single_object);
			}
			ResultSet rs1=c.getResult("select * from student_details");
			
			
			while(rs1.next()){
				StudentDetailsVo single_object=new StudentDetailsVo();
				single_object.setEmail_id(rs1.getString("email_id"));
				single_object.setStudent_name(rs1.getString("student_name"));
				student_list.add(single_object);
			}
			return SUCCESS;
					} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
			return ERROR;
		}
		
	}

}
